/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



//1st Button Command. New Floor Image.
function newFloorDialog(){
    $("#newFloorDialog").dialog({show: 'slide'});
    
}
//2nd Button Command. New Rack Instructions
function newRackDialog(){
    $("#newRackDialog").dialog({show: 'slide'});
}

//3rd Button Command. New Patch Panel.
function newPatchPanelDialog(){
    $("#newPatchPanelDialog").dialog({show: 'slide'});
        
}
//Once the submit button is pressed on newPatchPanelDialog...
function newPatchPanelSubmit(){
     $.ajax({
         url: 'newPatchPanel.php',
         data: {floor: $('#newPatchPanel_floor').val(),
                rack: $('#newPatchPanel_rack').val(),
                patchPanel: $('#newPatchPanel_patchPanel').val(),
                socket: $('#newPatchPanel_sockets').val()
            },
         type: 'get',
         dataType: 'json',
         success: function(jqXHR){
         $("#newPatchPanelDialog").dialog("close");
        },
         error: function(jqXHR){
             alert(jqXHR.responseText);
        $("#newPatchPanelDialog").dialog("close");    
        }      
 })
}
//4th Button Command. New Socket
function newSocketForm(){
    $("#newSocketForm").dialog({width: 350, position: 'right', show: 'slide'});
    
}



